package models

import "time"

// MyGormModel mix GormModel but uses uuid for ID,generated in go
type MyGormModel struct {
	ID        string `gorm:"primaryKey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type TimestampModel struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

// EmailTokenModel is an abstract model which can be used for objects from which
// we derive redirect emails(email confirmation,password reset and such)
type EmailTokenModel struct {
	MyGormModel
	Reference   string `gorm:"type:varchar(40);unique;not null"`
	EmailSent   bool   `gorm:"index;not null"`
	EmailSentAt *time.Time
	ExpiresAt   time.Time `gorm:"index;not null"`
}
